package com.comment.common;

public enum ResultCode {

    /* 成功状态码 */
    SUCCESS("0","操作成功！"),


    ADD_COMMENT_SUCCESS("1","评论成功"),

    /* 错误状态码 */
    FAIL("-1","操作失败！"),

    /* 参数错误：10001-19999 */
    PARAM_IS_INVALID("10001", "参数无效"),
    PARAM_IS_BLANK("10002", "参数为空"),
    PARAM_TYPE_BIND_ERROR("10003", "参数格式错误"),
    PARAM_NOT_COMPLETE("10004", "参数缺失"),

    /* 用户错误：20001-29999*/
    USER_NOT_LOGGED_IN("20001", "用户未登录，请先登录"),
    USER_LOGIN_ERROR("20002", "账号不存在或密码错误"),
    USER_ACCOUNT_FORBIDDEN("20003", "账号已被禁用"),
    USER_NOT_EXIST("20004", "用户不存在"),
    USER_HAS_EXISTED("20005", "用户已存在"),

    COUNT_TIME_ERROR("30001", "3s内只允许评论一次"),

    SYSTEM_INNER_ERROR("40001", "系统繁忙，请稍后重试"),


    /* 权限错误：70001-79999 */
    PERMISSION_UNAUTHENTICATED("70001","此操作需要登陆系统！"),
    PERMISSION_UNAUTHORISE("70002","权限不足，无权操作！"),
    PERMISSION_EXPIRE("70003","登录状态过期！"),
    PERMISSION_TOKEN_EXPIRED("70004", "token已过期"),
    PERMISSION_LIMIT("70005", "访问次数受限制"),
    PERMISSION_TOKEN_INVALID("70006", "无效token"),
    PERMISSION_SIGNATURE_ERROR("70007", "签名失败");
    ;


    private String code;
    private String message;

    ResultCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
